#include <iostream>
#include <string>
char *getInputName(void);
 using namespace std;
int main_delete()
{
  //获取用户输入的姓名
  char *content;
  content = getInputName();
  cout << "The content you input is: " << content << " address: " << (int *)content << " address1: " << &content << endl;
  delete [] content;
  //再次获取用户输入的姓名
  content = getInputName();
  cout << "The content you input is: " << content << " address: " << (int *)content << " address1: " << &content << endl;
  delete [] content;

  return 0;
}

char *getInputName(void) {
    char input[100];
   
    cout << "Please input your name: " << endl;
    cin >> input;
    char *result = new char[strlen(input) + 1];
    strcpy(result, input);
    return result;
}
